<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS回调</title>
</head>
<body>
<p id="demo"></p>
<script>
    function myDisplayer(some) {
    document.getElementById("demo").innerHTML = some;
  }

    function myCalculator(num1, num2, myCallback) {
    let sum = num1 + num2;
    myCallback(sum);
  }
    myCalculator(5, 5, myDisplayer);
</script>
</body>
</html>